import{request} from "./request";

//登录
export function login(account) {
    return request({
        url: '/login/cellphone?timestamp=' + new Date().getTime(),
        method: 'post',
        params:{
            phone: account.phone ,
            password: account.password
        },
        withCredentials: true
    })
}

//邮箱登录
export function emaillogin(account) {
    return request({
        url: '/login',
        method: 'post',
        params:{
            email: account.email ,
            password: account.password,
        },
        withCredentials: true
    })
}

// 退出登录
export function logout(){
    return request({
        url: '/logout',
        withCredentials: true
    })
}

// 登陆状态
export function status(){
    return request({
        url: '/login/status',
        withCredentials: true
    })

}

// 刷新登录
export function refresh(){
    return request({
        url: '/login/refresh',
        withCredentials: true
    })
}